import http from "@/utils/request/httpRequest.ts";
import type { ListPagination, ListType } from "@/types/commonType.ts";
import type { ExpertGroupListType, ExpertGroupAddType, ExpertGroupUpdateType, GroupType } from "@/types/expertGroup"

export const expertListApi = (params: ListPagination & {
    name: string
}) => http.get<ListType<ExpertGroupListType[]>>('teacher-group/pageGroup', {
    params
})

export const expertDeleteApi = (data: {
    id: string
}) => http.post('teacher-group/delete', data)

export const expertAddApi = (data: ExpertGroupAddType) => http.post<string>("teacher-group/add", data)

export const expertEditApi = (data: ExpertGroupUpdateType) => http.post<string>("teacher-group/update", data)

export const getTeacherList = (params: {
    current: number
    size: number
    groupId: string
    city: string
    channel: string
}) => http.get("teacher/getTeacherListNoGroup", {
    params
})

export const getTeacherIds = (data: GroupType) => http.post("teacher-group/getTeacherListByGroupId", data)

export const getTeacherInfo = (teacherId: string) => http.get(`teacher/echo?teacherId=${teacherId}`)